package com.pinapel.aixml.controller.Menu;

import com.pinapel.aixml.controller.IMainController;
import com.pinapel.aixml.controller.IMenuController;
import com.pinapel.aixml.models.EnumModelType;
import com.pinapel.aixml.models.Model;
import com.pinapel.aixml.ui.menuBar.MenuTools;

public class MenuToolsController implements IMenuToolsController {
	
	/** Reference to the view which is controlling **/
	private MenuTools mView;
	/** Reference to the controller above this (his hierarchical father) **/
	private IMenuController mTopController;
	
	/**
	 * Creates a new tools menu controller
	 * @param top his hierarchical father
	 */
	public MenuToolsController(IMenuController top) {
		mTopController = top;
	}

	@Override
	public IMainController getMainController() {
		return mTopController.getMainController();
	}

	@Override
	public Model getModel() {
		return this.getMainController().getModel();
	}

	@Override
	public void setTopController(IMenuController cont) {
		mTopController = cont;
	}

	@Override
	public void setView(MenuTools view) {
		mView = view;
		mView.setController(this);

	}

	@Override
	public void parse(EnumModelType currentTab) {
		this.getMainController().parse(currentTab);
	}

	@Override
	public void syntaxValidation(EnumModelType currentTab) {
		this.getMainController().syntaxValidation(currentTab);
	}

	@Override
	public void semanticValidation(EnumModelType currentTab) {
		this.getMainController().semanticValidation(currentTab);

	}

}
